using Game.Const;
using Game.Core;
using Game.Main.Model;
using Game.Manager;
using UnityEngine;

namespace Game.Component
{
	public class TreasureKeyBoxItem : BaseItem
	{
		public override void Init(ItemArchiveData data)
		{
			base.Init(data);
		}

		public override bool AttachItem(BaseItem item, DepthType depthType, AttachType attachType, bool updatePosition)
		{
			bool flag = base.AttachItem(item, depthType, attachType, updatePosition);
			if (flag)
			{
				if (parentItem != null && parentItem.itemData.scriptType == 42)
				{
					((TreasureKeyItem)parentItem).CheckState();
				}
				if (!updatePosition)
				{
					Singleton<AudioManager>.Instance.PlaySound("sound_embed");
					Singleton<AudioManager>.Instance.PlaySound("sound_blink");
					Singleton<EffectManager>.Instance.ShowEffect(PathConst.EFFECT + "efc_blink_1", item.transform.position + new Vector3(0f, 0f, -0.0004f), 3f);
				}
			}
			return flag;
		}
	}
}
